package com.atguigu.gulimall.product.service;

import com.atguigu.gulimall.product.vo.Catalog2VO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.product.entity.CategoryEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品三级分类
 *
 * @author DoGH
 * @email sunlightcs@gmail.com
 * @date 2023-10-25 10:37:42
 */
public interface CategoryService extends IService<CategoryEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 获取分类的树形结构
     *
     * @return {@link List }<{@link CategoryEntity }>
     * @author DuGuanghan
     * @since 2024-01-10 15:21:02
     */
    List<CategoryEntity> listWithTree();

    /**
     * 逻辑删除分类
     *
     * @param asList 分类Id
     * @author DuGuanghan
     * @since 2024-01-10 15:21:29
     */
    void removeMenuByIds(List<Long> asList);

    /**
     * 查询分类的路径
     *
     * @param catalogId 分类 ID
     * @return {@link Long[] }
     * @author DuGuanghan
     * @since 2024-01-10 15:20:58
     */
    Long[] findCatalogPath(Long catalogId);

    /**
     * 级联查询
     * 更新分类表时同时更新其他关联表
     *
     * @param category 分类
     * @author DuGuanghan
     * @since 2024-01-19 11:33:34
     */
    void updateCascadeById(CategoryEntity category);

    /**
     * 获取一级分类
     *
     * @return {@link List }<{@link CategoryEntity }>
     * @author DuGuanghan
     * @since 2024-04-28 15:31:06
     */
    List<CategoryEntity> getLevel1Catalog();

    /**
     * 获取首页三级分类
     *
     * @return {@link Map }<{@link String }, {@link Catalog2VO }>
     * @author DuGuanghan
     * @since 2024-04-28 17:12:27
     */
    Map<String, List<Catalog2VO>> queryCatalog();
}

